package cn.riverluoo.effectiveness;

import java.io.File;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import cn.riverluoo.console.ConsoleTextArea;


public class ShowDTD {

    public void showDTDMessage(String newname) throws ParserConfigurationException{

        ConsoleTextArea ct=new ConsoleTextArea();
        ct.showConsole();

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();

        File file = new File(newname);

        boolean validate = new DtdValidataXml().XMLValidateDTD(file);

        if (validate) {
            System.out.println("通过DTD校验！");
        } else {
            System.out.println("该XML文件未通过DTD校验,请检查错误信息！！！");
        }
    }

}
